package lanou3g.myfirstapp36kr.activity;

import android.content.Intent;
import android.print.PrintAttributes;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import lanou3g.myfirstapp36kr.R;
import lanou3g.myfirstapp36kr.base.BaseActivity;

/**
 * Created by dllo on 16/8/13.
 */
public class FragmentMoneyviewpagerFragmentLvDetailsActivity extends BaseActivity {
    private WebView webView;
    @Override
    protected int getLayout() {
        return R.layout.activity_framon_vp_fralv_detales;
    }

    @Override
    protected void initView() {
        webView = (WebView) findViewById(R.id.wb_framon_details);
        //返回键
        findViewById(R.id.iv_back_framon_details).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        //分享键
        findViewById(R.id.iv_share_framon_details).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });


    }

    @Override
    protected void initData() {
        Intent intent = getIntent();
        String stringUrl = intent.getStringExtra("FragmentMoneyviewPagerFragmentUrl");
        WebViewClient webViewClient = new WebViewClient();
        webView.setWebViewClient(webViewClient);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        webView.getSettings().setBuiltInZoomControls(true);
        openBrowser(stringUrl);

    }

    private void openBrowser(String url) {
        webView.loadUrl(url);
    }
}
